package cn.cqautotest.downloadfile

import android.os.Bundle
import android.os.Environment
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import cn.cqautotest.downloadfile.databinding.ActivityMainBinding
import cn.cqautotest.downloadfile.expand.Intent
import cn.cqautotest.downloadfile.download.DownloadFileService
import com.dylanc.viewbinding.inflate

class MainActivity : AppCompatActivity() {

    private val mBinding by inflate<ActivityMainBinding>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mBinding.btnStartDownFile.setOnClickListener {
            startService(Intent<DownloadFileService>(this))
        }
        mBinding.btnStopDownFile.setOnClickListener {
            stopService(Intent<DownloadFileService>(this))
        }
    }

    companion object {
        private const val TAG = "MainActivity"
    }
}